package com.testMaven;

import android.Manifest;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.pince.permission.PermissionCallback;
import com.pince.permission.PermissionHelper;

import java.util.HashMap;
import java.util.Map;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

//        Toast.makeText(this, MavenTest.getString(), Toast.LENGTH_LONG).show();
//

        Map<String, String> permissions = new HashMap<>();
        permissions.put(Manifest.permission.READ_EXTERNAL_STORAGE, "需要扩展卡权限");
        (new PermissionHelper(this)).request(permissions, new PermissionCallback() {
            @Override
            public void onGranted() {
                Toast.makeText(MainActivity.this, "获取权限成功", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onDenied(String permission, String tips) {
                super.onDenied(permission, tips);
                finish();
            }
        });
    }
}
